﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace DHJ.Cost.Timing
{
    [Serializable]
    public class Time
    {
        private Time()
        {
        }

        public Time(int year, int month)
        {
            Year = year;
            Month = month;
        }

        [Range(1900, 2099)]
        public int Year { get; set; }

        [Range(1, 12)]
        public int Month { get; set; }

        public DateTime GetStartDate()
        {
            return new DateTime(Year, Month -1 , CostConsts.MonthlyStartDay).Date;
        }

        public DateTime GetEndDate()
        {
            return new DateTime(Year, Month, CostConsts.MonthlyEndDay).Date;
        }
    }
}
